-module(char).
-compile(export_all).

-record(char, {name, hp, attack, defense}).

new(Name, Hp, Attack, Defense) ->
    #char{name = Name, hp = Hp, attack = Attack, defense = Defense}.
name(Char) ->
    Char#char.name.
hp(Char) ->
    Char#char.hp.
attack(Char) ->
    Char#char.attack.
defense(Char) ->
    Char#char.defense.
stats(Char) ->
    io_lib:format("[~s] HP: ~b Attack: ~b Defense: ~b",
                  [name(Char), hp(Char), attack(Char), defense(Char)]).
